Ext.ns('journal.preference');

// {{{
journal.preference.GeneralForm = Ext.extend(Ext.form.FormPanel, (function() {
    return {
        // defaults - can be changed from outside
        border : false,
        frame : true,
        labelWidth : 80,
        constructor : function(config) {
            config = config || {};
            config.listeners = config.listeners || {};
            journal.preference.GeneralForm.superclass.constructor.call(this, config);
        },
        initComponent : function() {

            // hard coded - cannot be changed from outside
            var config = {
                defaultType : 'textfield',
                monitorValid : true,
                autoScroll : true,
                autoWidth : true,
                bodyStyle : 'padding:5px 5px 0',
                layout : 'auto',
                defaults : {},
                items : [ {
                    xtype : 'checkbox',
                    boxLabel : 'Lock tree for drag and drop on load',
                    disabled : true
                } ],
                buttons : [ {
                    text : 'Restore Defaults',
                    scope : this,
                    handler : function() {
                    }
                }, {
                    text : 'Apply',
                    scope : this,
                    handler : function() {
                    }
                } ]
            }; // eo config object

            // apply config
            Ext.apply(this, Ext.apply(this.initialConfig, config));

            // call parent
            journal.preference.GeneralForm.superclass.initComponent.apply(this, arguments);

        }, // eo function initComponent

        /** Form override */
        onRender : function() {
            // call parent
            journal.preference.GeneralForm.superclass.onRender.apply(this, arguments);
            // set wait message target
            this.getForm().waitMsgTarget = this.getEl();
        } // eo function onRender

    };
})()); // eo extend

// register xtype
Ext.reg('journal.preference.GeneralForm', journal.preference.GeneralForm);